package com.httpDemo.doMain;

import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import lombok.Data;

/**
 * 使用@PropertySource注解可将自定义的配置文件中的值注入到ioc容器中，
 * 可用@ConfigurationProperties或@Value注解来获取。
 * 这个@PropertySource注解可配置在注解扫描到的任何类上，一般配置在启动类上。
 * 
 * @author Administrator
 *
 */
@Component
@ConfigurationProperties(prefix = "student")
@PropertySource(value = "classpath:student.properties")
@Data
public class Student {

	private Integer id;
	private String name;
	private String userName;
	private Integer age;
	private String[] hobby;
	private List<String> lists;
	private Map<String, String> maps;
	private Set<String> sets;
	private Date birth;

}
